package com.ocom.wxapi.client;

import com.ocom.common.constant.CompanyServiceUrl;
import com.ocom.common.dto.CompanyInfoDto;
import com.ocom.common.dto.GetCompanyRoleListDto;
import com.ocom.common.entity.company.EntityCompanyConfig;
import com.ocom.common.entity.human.EntityBizApply;
import com.ocom.common.entity.human.EntityBizLeaveApply;
import com.ocom.common.entity.master.EntityMngUserInfo;
import com.ocom.common.request.company.*;
import com.ocom.common.request.company.companyrole.GetRoleUserRequest;
import com.ocom.common.request.human.LeaveApplyDetailRequest;
import com.ocom.common.request.human.NewLeaveApplyRequest;
import com.ocom.common.request.ugcapi.GzhUserLeaveList;
import com.ocom.common.request.wx.RegisterPageRegisterRequest;
import com.ocom.common.request.wx.UnBindRequest;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.CompanyListInfoVo;
import com.ocom.common.vo.PageListResult;
import com.ocom.common.vo.company.*;
import com.ocom.common.vo.human.LeaveApplyDetailVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@FeignClient(value = "company")
public interface CompanyClientService {
    /**
     * 获取企业列表
     * @param openid
     * @return
     */
    @PostMapping(CompanyServiceUrl.URL_getCmpanyListByOpenid)
    Result getCmpanyListByOpenid(@RequestParam("openid") String openid);


    @PostMapping(CompanyServiceUrl.URL_Wx_AddCompanyInfo)
    Result addCompany(@RequestBody RegisterPageRegisterRequest request);

    @PostMapping(CompanyServiceUrl.URL_AddCompanyAdminInfo)
    Result AddCompanyAdminInfo(@RequestBody EntityMngUserInfo entityMngUserInfo);

    /**
     * 判断管理员是否存在
     * @param userName
     * @param password
     * @return
     */
    @PostMapping(CompanyServiceUrl.URL_isExistCompany)
    Result isExistCompany(@RequestParam("userName")String userName,@RequestParam("password")String password);


    @PostMapping(CompanyServiceUrl.URL_getCompanyInfoById)
    Result getCompanyInfoById(@RequestParam("companyId")Long companyId);


    @PostMapping(CompanyServiceUrl.URL_UpdateCompanyInfo)
    Result UpdateCompanyInfo(@RequestBody CompanyInfoDto companyInfo);

    @PostMapping(CompanyServiceUrl.URL_AddCompanyInfo)
    Result AddCompanyInfo(@RequestBody CompanyInfoDto companyInfo);


    @PostMapping(CompanyServiceUrl.URL_modifyColor)
    Result  modifyColor(@RequestParam("companyId")Long companyId,@RequestParam("colorNo")String colorNo);


    @PostMapping(CompanyServiceUrl.URL_modifyName)
    Result  modifyName(@RequestParam("companyId")Long companyId,@RequestParam("companyName")String companyName);

    @PostMapping(CompanyServiceUrl.URL_modifyPid)
    Result  modifyPid(@RequestParam("companyId")Long companyId,@RequestParam("pId")Long pId);

    @PostMapping(CompanyServiceUrl.URL_GetCompanyListInfo)
    public Result GetCompanyListInfo(@RequestBody CompanyListInfoVo companyListInfoVo);

    /**
     * 4.28获取角色用户小程序菜单权限（getAppMenuByRole）
     */
    @PostMapping(CompanyServiceUrl.URL_getAppMenuByRole)
    public Result getAppMenuByRole(@RequestBody GetRoleUserRequest request);


    @PostMapping(CompanyServiceUrl.URL_unbingWxCompanyAdmin)
    public Result  unbingWxCompanyAdmin(@RequestBody UnBindRequest request);

    @PostMapping(CompanyServiceUrl.URL_getCompanyRole)
    public Result<List<CompanyRoleListVo>> getCompanyRole(@RequestBody GetCompanyRoleListDto dto);

    @PostMapping(CompanyServiceUrl.URL_getFlowkeyByPid)
    public Result<FlowConfigVo> getFlowkeyByPid(@RequestBody GetFlowkeyByPidRequest getFlowkeyByPidRequest);

    @PostMapping(CompanyServiceUrl.URL_getApplyTasks)
    public Result<List<FlowInstanceInfoVo>> getApplyTasks(@RequestBody GetApplyTasksRequest getApplyTasksRequest);

    @PostMapping(CompanyServiceUrl.URL_getFlowListByCom)
    public Result<List<GetFlowListByComVo>> getFlowListByCom(@RequestBody GetFlowListByComRequest getFlowListByComRequest);

    @PostMapping(CompanyServiceUrl.URL_getFlowApprovalDetail)
    public  Result<List<GetFlowApprovalDetailVo>> getFlowApprovalDetail(@RequestBody GetFlowApprovalDetailRequest getFlowApprovalDetailRequest);

    @PostMapping(CompanyServiceUrl.URL_getLoginCompanyList)
    public Result getLoginCompanyList(@RequestBody GetLoginCompanyListRequest request);

    //获取一个单位信息
    @PostMapping(CompanyServiceUrl.URL_GetCompanyListInfoOne)
    Result GetCompanyListInfoOne(@RequestParam("companyId") Long companyId);

    @PostMapping(CompanyServiceUrl.URL_refreshRecentCompany)
    public Result refreshRecentCompany(@RequestBody RefreshRecentCompanyRequest request);

    @PostMapping(CompanyServiceUrl.URL_updateLeavelApply)
    public Result updateLeavelApply(@RequestBody EntityBizLeaveApply entityBizLeaveApply);

    @PostMapping(CompanyServiceUrl.URL_leavelApplyList)
    public Result<PageListResult<EntityBizLeaveApply>> leavelApplyList(@RequestBody GzhUserLeaveList request);

    @PostMapping(CompanyServiceUrl.URL_leavelApplyOne)
    public Result<EntityBizLeaveApply> leavelApplyOne(@RequestBody EntityBizLeaveApply entityBizLeaveApply);

    @PostMapping(CompanyServiceUrl.URL_leaveApplyDetail)
    public Result<LeaveApplyDetailVo> leaveApplyDetail(@RequestBody LeaveApplyDetailRequest leaveApplyDetailRequest);

    @PostMapping(CompanyServiceUrl.URL_newLeaveApply)
    public Result<EntityBizLeaveApply> newLeaveApply(@RequestBody NewLeaveApplyRequest leaveApplyRequest);

    @PostMapping(CompanyServiceUrl.URL_newApply)
    public Result newApply(@RequestBody NewApplyRequest applyRequest);


    @PostMapping(CompanyServiceUrl.URL_handleApply)
    public Result handleApply(@RequestBody HandleApplyRequest applyRequest);

    @PostMapping(CompanyServiceUrl.URL_getApplyListByPid)
    public Result getApplyListByPid(@RequestBody EntityBizApply entityBizApply);

    /**
     * 3.22获取单位功能配置列表(getCompanyConfig)
     */
    @PostMapping(CompanyServiceUrl.URL_getCompanyConfig)
    Result<List<EntityCompanyConfig>> getCompanyConfig(@RequestParam("comId") Long companyId, @RequestParam("tab")String tab);


}

